package com.tc.itfarm.web.action;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.tc.itfarm.model.User;
import com.tc.itfarm.service.UserService;

@Controller
@RequestMapping("/user")
public class UserAction {
	
	@Resource
	private UserService userService;
	
	@RequestMapping("add")
	public String add() {
		User user = new User();
		user.setUsername("wdd");
		user.setNickname("爱吃猫的鱼");
		user.setPassword("123");
		user.setEmail("asdds");
		userService.save(user);
		return "user";
	}
	
	@RequestMapping("hello")
	public String hello(){
		return "user";
	}
	
}
